﻿// Original author contact info: Owen Emlen (owene_1998@yahoo.com)
// Note: other individuals may also have contributed to this code
// Project hosted on CodePlex.com as of 1/10/2009 at http://www.codeplex.com/EmlenMud
using System.Runtime.Serialization;
using System.Text;
using System;
using System.Threading;
using System.ComponentModel;
using System.Windows;
using System.Collections;
using System.Collections.Generic;
using BrainTechLLC.ThreadSafeObjects;
#if USE_HYPER
using Hyper.ComponentModel;
#endif

namespace BrainTechLLC
{
    public partial class GameChar : GameThingBaseClass, IKeywordAccessible, IGameThing,
        IChangeable, INotifiable, ICanBeNotified, IHasPropertyData, ICanBePlacedInWorld,
        IHasLocationInt, IHasNameAndDescription, IRaisesNotifications, ICanReceiveCommands,
        INotifyPropertyChanged, IViewableThing,
        ICanObserveViewable, IEventPerceiver, INotifyPropertyChanging
    {
        public override void RegisterChildrenForPropertyChangeEvents()
        {   
#if NO_SILVERLIGHT
            Name.PropertyChanging += new PropertyChangingEventHandler(Name_PropertyChanging);
            LocationInt.PropertyChanging += new PropertyChangingEventHandler(LocationInt_PropertyChanging);
#else
            Name.PropertyChanging += new EventHandler<PropertyChangingEventArgsEx>(Name_PropertyChanging);
            LocationInt.PropertyChanging += new EventHandler<PropertyChangingEventArgsEx>(LocationInt_PropertyChanging);
#endif
            Name.PropertyChanged += new PropertyChangedEventHandler(Name_PropertyChanged); 
            LocationInt.PropertyChanged += new PropertyChangedEventHandler(LocationInt_PropertyChanged);            
            base.RegisterChildrenForPropertyChangeEvents();
        }

        void LocationInt_PropertyChanging(object sender, PropertyChangingEventArgsEx e)
        {
            PropertyChangingEventArgsEx args = e as PropertyChangingEventArgsEx;
            OnPropertyChanging(sender, args);
        }

        void Name_PropertyChanging(object sender, PropertyChangingEventArgsEx e)
        {
            PropertyChangingEventArgsEx args = e as PropertyChangingEventArgsEx;
            OnPropertyChanging(sender, args);
        }

        void LocationInt_PropertyChanging(object sender, PropertyChangingEventArgs e)
        {
            PropertyChangingEventArgsEx args = e as PropertyChangingEventArgsEx;
            OnPropertyChanging(sender, args);
        }

        void LocationInt_PropertyChanged(object sender, PropertyChangedEventArgs e)
        {
            PropertyChangedEventArgsEx args = e as PropertyChangedEventArgsEx;
            OnPropertyChanged(sender, args);
        }

        void Name_PropertyChanging(object sender, PropertyChangingEventArgs e)
        {
            PropertyChangingEventArgsEx args = e as PropertyChangingEventArgsEx;
            OnPropertyChanging(sender, args);
        }

        void Name_PropertyChanged(object sender, PropertyChangedEventArgs e)
        {
            PropertyChangedEventArgsEx args = e as PropertyChangedEventArgsEx;
            OnPropertyChanged(sender, args);
        }
    }
}